﻿using System.Windows;
using System.Windows.Controls;

namespace TouchBehaviorsSampleApp.UserControls
{
    /// <summary>
    /// Interaction logic for EllipseItem.xaml
    /// </summary>
    public partial class EllipseItem : UserControl
    {
        public EllipseItem()
        {
            InitializeComponent();
        }

        #region Dependency Properties
        public static readonly DependencyProperty CanTranslateProperty =
            DependencyProperty.Register("CanTranslateCheck", typeof(bool), typeof(EllipseItem), null);

        public bool CanTranslateCheck
        {
            get { return (bool)GetValue(CanTranslateProperty); }
            set { SetValue(CanTranslateProperty, value); }
        }

        public static readonly DependencyProperty CanRotateProperty =
            DependencyProperty.Register("CanRotateCheck", typeof(bool), typeof(EllipseItem), null);

        public bool CanRotateCheck
        {
            get { return (bool)GetValue(CanRotateProperty); }
            set { SetValue(CanRotateProperty, value); }
        }

        public static readonly DependencyProperty CanScaleProperty =
            DependencyProperty.Register("CanScaleCheck", typeof(bool), typeof(EllipseItem), null);

        public bool CanScaleCheck
        {
            get { return (bool)GetValue(CanScaleProperty); }
            set { SetValue(CanScaleProperty, value); }
        }
        #endregion

        #region EventCallSites
        private void CanScale_Checked(object sender, RoutedEventArgs e)
        {
            this.CanScaleCheck = (bool)CanScaleCheckBox.IsChecked;
        }

        private void CanRotate_Checked(object sender, RoutedEventArgs e)
        {
            this.CanRotateCheck = (bool)CanRotateCheckBox.IsChecked;
        }

        private void CanTranslate_Checked(object sender, RoutedEventArgs e)
        {
            this.CanTranslateCheck = (bool)CanTranslateCheckBox.IsChecked;
        }
        #endregion
    }
}
